package com.sprucetec.live.enums;

/**
 * @author chenkai
 * @date 2020/4/3 12:29 下午
 * @description:
 */
public enum LiveStatusEnum {

    NOLIVE(0,"未直播"),
    LIVEING(1,"正在直播"),
    LIVEEND(2,"直播结束");

    private Integer code;

    private String desc;

    LiveStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String code2Desc(Integer code) {
        for (LiveStatusEnum status : LiveStatusEnum.values()) {
            if (status.getCode().equals(code)) {
                return status.getDesc();
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
